import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
// element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 样式相关
import 'virtual:uno.css' //引入unocss
import './assets/css/index.scss' //引入全局样式
// 引入 Font Awesome 图标库
import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { fas } from '@fortawesome/free-solid-svg-icons'
// 将所有的 solid 图标添加到库中
library.add(fas)

const app = createApp(App)
app.use(createPinia())
app.use(router)
// 全部引入element-plus
app.use(ElementPlus, {
  locale: zhCn,
})
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 注册 FontAwesomeIcon 组件
app.component('font-awesome-icon', FontAwesomeIcon)

app.mount('#app')
